package com.yima.baseproj.module.app.equipmentEquipment;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yima.baseproj.module.config.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import com.yima.baseproj.module.app.equipmentEquipment.model.*;

@Data
@TableName("equipment_equipment")
public class EquipmentEquipmentEntity extends BaseEntity {


    @ApiModelProperty(value = "用户表openid")
    @TableField(value = "user_openid")
    private String userOpenid;


    @ApiModelProperty(value = "设备名称")
    @TableField(value = "name")
    private String name;


    @ApiModelProperty(value = "设备标签")
    @TableField(value = "tag")
    private String tag;


    @ApiModelProperty(value = "场景 Guid")
    @TableField(value = "sceneGuid")
    private String sceneguid;


    @ApiModelProperty(value = "设备来源")
    @TableField(value = "source")
    private String source;


    @ApiModelProperty(value = "设备序列号")
    @TableField(value = "deviceNo")
    private String deviceno;


    @ApiModelProperty(value = "扩展字段（uface 设备（recType 设备的识别方式, 默认为 1）")
    @TableField(value = "addition")
    private String addition;


    @ApiModelProperty(value = "是否绑定默认场景（场景 Guid 为空此字段生效）")
    @TableField(value = "bindDefaultScene")
    private String binddefaultscene;


    @ApiModelProperty(value = "是否清空设备数据，默认为false")
    @TableField(value = "forceEmptyDevice")
    private String forceemptydevice;


    @ApiModelProperty(value = "当forceEmptyDevice为true，传入设备密码")
    @TableField(value = "password")
    private String password;
    @ApiModelProperty(value = "状态 1在线  2离线")
    @TableField(value = "status")
    private int status;

    public void setData(EquipmentEquipmentAddParamModel paramModel) {
        this.userOpenid = paramModel.getUserOpenid();
        this.name = paramModel.getName();
        this.tag = paramModel.getTag();
        this.sceneguid = paramModel.getSceneguid();
        this.source = paramModel.getSource();
        this.deviceno = paramModel.getDeviceno();
        this.addition = paramModel.getAddition();
        this.binddefaultscene = paramModel.getBinddefaultscene();
        this.forceemptydevice = paramModel.getForceemptydevice();
        this.password = paramModel.getPassword();
        this.status = paramModel.getStatus();
    }
}